package com.chen.tliaswebtest.controller;

import com.chen.tliaswebtest.pojo.Result;
import com.chen.tliaswebtest.pojo.User;
import com.chen.tliaswebtest.service.LogInService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chen
 * @version 1.0
 * @create_date 2025/7/25
 * 登录控制器
 */
@RestController
public class LogInController {
    private final LogInService logInService;

    public LogInController(LogInService logInService) {
        this.logInService = logInService;
    }

    @PostMapping("/login")
    public Result logIn(@RequestBody User user) {
        return Result.success(logInService.logIn(user));
    }
}
